home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#49 (Oct 89)
/
Jorgs Source
/
FillRRect.c
next >
Wrap
Text File
|
1989-08-18
|
1KB
|
76 lines
/*
* FillRoundRect class
*
* © Joerg Langowski/MacTutor 1989
*
* SuperClasses :
*
* Instance Vars :
*
* Class Vars :
*
* Methods :
*
* Class Methods :
*
*/
#include "oic.h"
#include "generics.h"
class FillRRect;
struct FillRRect_i /* FillRRect instance structure */
{
Rect myRect;
int ovalWidth,ovalHeight;
Pattern *pat;
};
typedef struct FillRRect_i FillRRect_i;
/* -------------------- FillRRect Instance methods ------------------- */
static object
_new(self, r, ra)
object self;
FillRRect_i *r;
struct {
double top;
double left;
double bottom;
double right;
double ovalWidth;
double ovalHeight;
Pattern *pat;
} *ra;
{
r->myRect.top = ra->top;
r->myRect.left = ra->left;
r->myRect.bottom = ra->bottom;
r->myRect.right = ra->right;
r->ovalWidth = ra->ovalWidth;
r->ovalHeight = ra->ovalHeight;
r->pat = ra->pat;
return Super(self);
}
static
_draw(self, r)
object self;
FillRRect_i *r;
{
FillRoundRect(&r->myRect,r->ovalWidth,r->ovalHeight,r->pat);
}
/* ------------------- Init the FillRRect class ---------------------- */
InitFillRRect()
{
FillRRect = NewClass(sizeof(FillRRect_i), 0, "FillRRect", END);
AddMethods(FillRRect,
newGeneric, _new,
drawGeneric, _draw,
END);
}